home *** CD-ROM | disk | FTP | other *** search
-
-
-
-
-
- Reply to Mush...
-
- I think I know what you are trying to do in your box-line thing so I will
- try and explain two methods I know...
- To get the Y position of the slope as you go from one point to another can
- be solved by using either a linedraw routine or calculating the difference
- of Y position on the slope and adding it (negative gradients as well) to
- the current Y position...
-
- The first method can be done by using a Bresnham (i think thats how you
- spell it ;-) line draw, this basically is a line draw routine that uses
- only integer numbers... you give the line routine the start and end (the
- top and bottom of you box) and for every increment in the x position, you
- will be able to get the y position, and becoz the box can probably be
- reflected horizontally you can just use -ypos+screenheight to get the
- bottom of the box Y co-ord.
-
- The second method means getting the gradient of the slope and doing a loop
- from the start X to the end X of the box and for every point inbetween,
- increment the y position by the difference in heght between each pixel,
- this does mean using floating point numbers thought so it`s VERY slow, but
- then again, so was the first method(slow I mean...) but at least they work
- :-)
-
- I will try and post the bresenham linedraw routine... I use it for
- raycasting at the moment(that will soon change though)
-
- Lee Howarth
-
-
-
-